﻿//-----------------------------------------------------------------------
// <copyright file="IFinder.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: IFinder.cs
// * history : created by qinchaoyue 2017-10-22 07:15:41
// </copyright>
//-----------------------------------------------------------------------

using System;

namespace Slwy.FrameCore.Reflection
{
    /// <summary>
    /// 定义一个查找器
    /// </summary>
    /// <typeparam name="TItem">要查找的类型</typeparam>
    public interface IFinder<out TItem>
    {
        /// <summary>
        /// 查找指定条件项
        /// </summary>
        /// <param name="predicate">筛选条件</param>
        /// <returns>结果集合</returns>
        TItem[] Find(Func<TItem, bool> predicate);

        /// <summary>
        /// 查找所有项
        /// </summary>
        /// <returns>结果集合</returns>
        TItem[] FindAll();
    }
}
